// CollectDlg.cpp : implementation file
//

#include "stdafx.h"
#include "frontManage.h"
#include "CollectDlg.h"


// CCollectDlg dialog

IMPLEMENT_DYNAMIC(CCollectDlg, CDialog)

CCollectDlg::CCollectDlg(CWnd* pParent /*=NULL*/)
	: CDialog(CCollectDlg::IDD, pParent)
	, m_Amount(0)
	, m_collected(0)
	, change(0)
{

}

CCollectDlg::~CCollectDlg()
{
}

void CCollectDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	DDX_Text(pDX, IDC_AMOUNT, m_Amount);
	DDX_Text(pDX, IDC_COLLECTED, m_collected);
	DDX_Text(pDX, IDC_CHANGE, change);
}


BEGIN_MESSAGE_MAP(CCollectDlg, CDialog)
	ON_EN_CHANGE(IDC_COLLECTED, &CCollectDlg::OnEnChangeCollected)
	ON_BN_CLICKED(IDOK, &CCollectDlg::OnBnClickedOk)
END_MESSAGE_MAP()


// CCollectDlg message handlers

BOOL CCollectDlg::OnInitDialog()
{
	CDialog::OnInitDialog();
	change = m_collected - m_Amount;

	// TODO:  Add extra initialization here

	return TRUE;  // return TRUE unless you set the focus to a control
	// EXCEPTION: OCX Property Pages should return FALSE
}

void CCollectDlg::OnEnChangeCollected()
{
	UpdateData();
	change = m_collected - m_Amount;
	UpdateData(FALSE);
	// TODO:  If this is a RICHEDIT control, the control will not
	// send this notification unless you override the CDialog::OnInitDialog()
	// function and call CRichEditCtrl().SetEventMask()
	// with the ENM_CHANGE flag ORed into the mask.

	// TODO:  Add your control notification handler code here
}

void CCollectDlg::OnBnClickedOk()
{
	// TODO: Add your control notification handler code here
	OnOK();
}
